MessageThreadViewModel

open class MessageThreadViewModel : BaseMessageListViewModel

ViewModel preparing and managing data related with the list of threads in a parent message since 3.3.0

Constructors

Link copied to clipboard
open fun MessageThreadViewModel(    @NonNull channelUrl: String,     @NonNull parentMessage: BaseMessage,     @Nullable messageListParams: ThreadMessageListParams)
Constructor

Functions

Link copied to clipboard
open fun authenticate(@NonNull handler: AuthenticateHandler)
Tries to connect Sendbird Server and retrieve a channel instance.
Link copied to clipboard
open fun buildMessageList(): List<BaseMessage>
Processes a list of messages to be passed to the view.
Link copied to clipboard
open fun createMessageListParams(): ThreadMessageListParams
Creates params for the thread list when loading the thread list.
Link copied to clipboard
open fun deleteMessage(@NonNull message: BaseMessage, @Nullable handler: OnCompleteHandler)
Deletes a message.
Link copied to clipboard
open fun getStartingPoint(): Long
Returns the timestamp that is the starting point when the thread list is fetched initially.
Link copied to clipboard
open fun getStatusFrame(): LiveData<StatusFrameView.Status>
Returns LiveData that can be observed for the status of the result of fetching the thread list.
Link copied to clipboard
open fun hasNext(): Boolean
Determine whether the data on the next page exists.
Link copied to clipboard
open fun hasPrevious(): Boolean
Determine whether the data on the previous page exists.
Link copied to clipboard
open fun loadInitial(startingPoint: Long)
Requests the list of BaseMessages for the first time.
Link copied to clipboard
open fun loadNext(): List<BaseMessage>
Requests the list of BaseMessages when the page goes to the next.
Link copied to clipboard
open fun loadPrevious(): List<BaseMessage>
Requests the list of BaseMessages when the page goes to the previous.
Link copied to clipboard
open fun onChannelDeleted(): LiveData<Boolean>
Returns LiveData that can be observed if the channel has been deleted.
Link copied to clipboard
open fun onChannelUpdated(): LiveData<GroupChannel>
Returns LiveData that can be observed if the channel has been updated.
Link copied to clipboard
protected open fun onCleared()
Link copied to clipboard
open fun onParentMessageDeleted(): LiveData<Boolean>
Returns LiveData that can be observed if the parent message has been deleted.
Link copied to clipboard
open fun onParentMessageUpdated(): LiveData<BaseMessage>
Returns LiveData that can be observed if the parent message has been updated.
Link copied to clipboard
open fun onReconnected(): LiveData<Boolean>
Returns LiveData that can be observed if the chat server has been reconnected.
Link copied to clipboard
open fun onThreadMessageDeleted(): LiveData<Long>
Returns LiveData that can be observed if the thread message has been deleted.
Link copied to clipboard
open fun updateUserMessage(    messageId: Long,     @NonNull params: UserMessageUpdateParams,     @Nullable handler: OnCompleteHandler)
Updates a text message with messageId.

Properties

Link copied to clipboard
open val parentMessage: BaseMessage